# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=flashcache-utils
pkgver=3.1.3
pkgrel=0
pkgdesc="Userspace utilities for flashcache"
url="https://github.com/facebook/flashcache"
arch="all"
license="GPL"
depends=""
depends_dev=""
makedepends="$depends_dev linux-headers"
install=""
subpackages=""
source="flashcache-$pkgver.tar.gz::https://github.com/facebook/flashcache/archive/$pkgver.tar.gz"

_builddir="$srcdir"/flashcache-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"/src
	make -C utils
}

package() {
	cd "$_builddir"/src/utils
	make install DESTDIR="$pkgdir" || return 1
}

sha512sums="f7577993ca7962231b19d3141da22268f9b36bf2d60b83ad33c9cabcbae82db2ff2a1697a7137db61b06d5a8ea897a11dc7a80c9c85184c47feddd57d2297275  flashcache-3.1.3.tar.gz"
